package dao;

import java.util.List;

import model.Event;
import model.EventType;
import model.Subject;
import modelInterfaces.IEvent;
import modelInterfaces.IEventType;
import modelInterfaces.ISubject;

/**
*
* Interface that all EventDAOs must support
*/
public interface IEventDAO {
    
	/**
	 * Create a {@link Event} in database depending a parameter event.
	 * @param event	event to be created
	 * @throws DAOException
	 * @see Event
	 */
	public void create(IEvent event) throws DAOException;
    
	
	/**
	 * Delete a {@link Event} in database depending a parameter event.
	 * @param event	event to be deleted
	 * @throws DAOException
	 * @see Event
	 */	
	public void delete(IEvent event) throws DAOException;
    
	
	/**
	 * Update a {@link Event} in database depending a parameter event.
	 * @param event	event to be updated
	 * @throws DAOException
	 * @see Event
	 */		
	public void update(IEvent event) throws DAOException;
    
	
	
	/**
	 * Retrieve a list with all events of database.
	 * @return list with all events of database. 
	 * @throws DAOException
	 * @see Event
	 */	
	public List<IEvent> retrieveAll() throws DAOException;
    
	
	/**
	 * Retrieve a {@link Event} list in database depending of parameter subject.
	 * @param subject subject realizes a event
	 * @return list of events according to a subject
	 * @throws DAOException
	 * @see Event
	 * @see Subject
	 */		
	public List<IEvent> retrieveAll(ISubject subject) throws DAOException;
    
	
	/**
	 * Retrieve a {@link Event} list in database depending of parameter type.
	 * @param type	identifier number of a event type 
	 * @return list of events according to a event type
	 * @throws DAOException
	 * @see Event
	 * @see EventType
	 */			
	public List<IEvent> retrieveAllFromType(int type) throws DAOException;
	

	/**
	 * Retrieve a {@link Event} list in database depending of parameter eventTypes.
	 * @param eventTypes	list of event types 
	 * @return list of events according to event types. By default, events have not event type and have not values but response time will be faster. 
	 * @throws DAOException
	 * @see Event
	 * @see EventType
	 */			
	public List<IEvent> retrieveAllFromTypes(List<IEventType> eventTypes) throws DAOException;
    
	
	/**
	 * Retrieve a {@link Event} list in database depending of parameter eventTypes, hasEventType and hasValues.
	 * @param eventTypes	list of event types
	 * @param hasEventType	if true, events will have event type but response time will be slower, otherwise will not have.
	 * @param hasValues		if true, events will have values but response time will be slower, otherwise will not have.
	 * @return list of events according to event types. 
	 * @throws DAOException
	 * @see Event
	 * @see EventType
	 */	
	public List<IEvent> retrieveAllFromTypes(List<IEventType> eventTypes, boolean hasEventType, boolean hasValues) throws DAOException;    
	
	
	
	
	/**
	 * Retrieve a {@link Event} list in database depending of parameter subject and type.
	 * @param subject subject realizes a event
	 * @param type identifier number of a event type 
	 * @return list of events  according to subject and event type
	 * @throws DAOException
	 * @see Event
	 * @see Subject
	 * @see EventType
	 */	    
	public List<IEvent> retrieveAllFromType(ISubject subject, int type) throws DAOException;
    
    
    
	/**
	 * Get a total number of events in database.
	 * @return total number of events in database.
	 * @throws DAOException
	 * @see Event
	 */	  
    public int totalAmount() throws DAOException;

}
